<h1>Listing stories</h1>

<table>
	<tr>
		<th>Story</th>
		<th>Created</th>
		<th>Updated</th>
	</tr>
	
	<% for story in @stories %>
		<tr class="<%= cycle('odd', 'odd', 'odd', 'even', 'even', 'even') %>">
			<td><%= h story.title %></td>
			<td><%= h story.created_on.to_s(:short12) %></td>
			<td><%= h story.updated_on.to_s(:short12) %></td>
		</tr>	 
		<tr class="<%= cycle('odd', 'odd', 'odd', 'even', 'even', 'even') %>">
			<td colspan="3">
				<% story.tuples_to_s do |it| %>
				<%= h "#{it}, "  %>
				<% end %>
			</td>
		</tr>		 
		<tr class="<%= cycle('odd', 'odd', 'odd', 'even', 'even', 'even') %>">
			<td colspan="3"><%= link_to 'Show', :action => 'show', :id => story %>
			<%= link_to 'Edit', :action => 'edit', :id => story %>
			<%= link_to 'Destroy', { :action => 'destroy', :id => story }, :confirm => 'Are you sure?', :method => :post %></td>
		</tr>
	<% end %>
</table>

<%= link_to 'Previous page', { :page => @story_pages.current.previous } if @story_pages.current.previous %>
<%= link_to 'Next page', { :page => @story_pages.current.next } if @story_pages.current.next %> 

<br />

<%= link_to 'New story', :action => 'new' %>
